<template>
  <div class="detailsLayOut" v-if="bufferData">
    <div class="topImgText">
      <p><van-icon name="wap-home-o" class="iconFont" />首页 / 视频详情</p>
      <!-- 大图 -->
      <div class="imgBox">
        <img :src="bufferData.bannerFileUrl" alt="" class="bufferImg" />
      </div>
      <!-- tab切换 -->
      <CourseDescriptionTab :description="bufferData"></CourseDescriptionTab>
    </div>
    <!-- 底部购物车 爱心 购买 -->
    <div class="greyLine"></div>
    <div class="bottomShop">
      <van-icon name="like-o" class="bottomIconFont" /> &nbsp;
      <van-icon name="shopping-cart-o" class="bottomIconFont" />
      <button class="bottomImmediately" >立即购买</button>
      <button class="bottomWatch">立即观看</button>
    </div>
  </div>
</template>

<script>
import { getBufferData } from "../../api/index-api";
import CourseDescriptionTab from "./components/CourseDescriptionTab";
export default {
  name: "DetailsLayOut",
  data() {
    return {
      bufferData: null, //缓冲页数据
    };
  },
  created() {
    //   请求详情页信息
    getBufferData(this.$route.query.courseId).then((res) => {
      console.log(res);
      this.bufferData = res.data;
    });
  },
  components: {
    CourseDescriptionTab,
  },
};
</script>

<style lang="less" scoped>
.topImgText {
  padding-top: 1px;
  background: rgb(243, 239, 239);
  min-height: 200px;
  //   height: auto;
  .iconFont {
    vertical-align: middle;
  }
}
.bufferImg {
  width: 100%;
}
p {
  margin: 10px 0 0 5px;
  margin-top: 10px;
  color: rgba(0, 0, 0, 0.45);
  font-size: 14px;
}
.imgBox {
  margin-top: 20px;
}
.bottomShop {
  height: 50px;
  position: fixed;
  width: 100%;
  bottom: 0;
  line-height: 56px;
  font-size: 22px;

  .bottomImmediately {
    background: rgb(255, 128, 0);
    border: rgb(255, 128, 0);
    color: white;
    height: 28px;
    line-height: 28px;
    font-size: 14px;
    padding: 0 5px;
    position: absolute;
    right: 15px;
    bottom: 10px;
        box-shadow: 0 2px 0 rgba(0,0,0,.045);
  }
  .bottomWatch{
     color: #fff;
    background-color: #00cf8c;
    border-color: #00cf8c; 
    height: 28px;
    line-height: 28px;
    font-size: 14px;
    padding: 0 5px;
    position: absolute;
    right: 15px;
    bottom: 10px;
        box-shadow: 0 2px 0 rgba(0,0,0,.045);
  }
}
.bottomIconFont {
  margin-left: 15px;
}
.greyLine{
    height: 20px;
    background-color:  rgb(243, 239, 239);
}
</style>